<div class="waypoint container contact">
    <?php 
        if ($this->company['logo'] == '') {
            $imgLogo = '/img/default-logo.jpg';
        }else {
            $imgLogo = $this->company['logo'];
        }
    ?>
    
    <!-- header -->
    <div class="row">
        <div class="col-md-12">
            <div class="col-md-2" style="height: 100%; vertical-align: middle;"><img class="img-thumbnail" src="<?php echo $this->baseUrl().$imgLogo;  ?>"></div>
            <div class="col-md-6">
                <div class="row"><span style="font-size: 40px; color: #5b5b5b;"><?php echo $this->company['name'];  ?></span></div>
                <div class="row"><a href="http://<?php echo $this->company['site']; ?>" target="_new" style="font-size: 20px;"><?php echo $this->company['site']; ?></a></div>
                
            </div>
            <div class="col-md-4">
                <div class="row center" style="width: 100%; text-align: center;"> 
                    <div id="general-rate" style="width: 100%; text-align: center; margin-left: 55px;" data-score="<?php echo $this->company['star_rate']; ?>"> </div>
                </div>
                <div class="row center" style="width: 100%; text-align: center;"> <h2><?php echo $this->company['star_rate']; ?></h2> </div>
                
            </div>
        </div>
    </div>
    
    <!-- content -->
    <div class="row" style="padding-top: 30px">
        <div class="col-md-3" style="margin-right: 10px; background-color: #e5e5e5; width: 315px; height: 380px;">
            <div class="row" style="width: 100%; text-align: center;"> <h2> Avaliações </h2> </div>
            <!--   Inicio Estrelas -->
            <div class="row">
                <div class="col-sm-7" style="font-size: 13px;"> Visão & Estratégia: </div>
                <div class="rate col-md-5" data-score="<?php echo $this->company['strategy']; ?>"> </div>
            </div>
            <div class="row">
                <div class="col-sm-7" style="font-size: 13px;"> Chefia: </div>
                <div class="rate col-md-5" data-score="<?php echo $this->company['leadership']; ?>"> </div>
            </div>
            <div class="row">
                <div class="col-sm-7" style="font-size: 13px;"> Cultura & Valores: </div>
                <div class="rate col-md-5" data-score="<?php echo $this->company['culture']; ?>"> </div>
            </div>
            <div class="row">
                <div class="col-sm-7" style="font-size: 13px;"> Oportunidade/Carreira: </div>
                <div class="rate col-md-5" data-score="<?php echo $this->company['opportunity']; ?>"> </div>
            </div>
            <div class="row">
                <div class="col-sm-7" style="font-size: 13px;">  Reconhecimento/Promoção: </div>
                <div class="rate col-md-5" data-score="<?php echo $this->company['recognition']; ?>"> </div>
            </div>
            <div class="row">
                <div class="col-sm-7" style="font-size: 13px;"> Ambiente de Trabalho: </div>
                <div class="rate col-md-5" data-score="<?php echo $this->company['workspace']; ?>"> </div>
            </div>
            <div class="row">
                <div class="col-sm-7" style="font-size: 13px;"> Pagamento em dia: </div>
                <div class="rate col-md-5" data-score="<?php echo $this->company['payment']; ?>"> </div>
            </div>
            <div class="row">
                <div class="col-sm-7" style="font-size: 13px;"> Flexibilidade Horário: </div>
                <div class="rate col-md-5" data-score="<?php echo $this->company['flexibility']; ?>"> </div>
            </div>
            <div class="row">
                <div class="col-sm-7" style="font-size: 13px;"> Sobrecarga de tarefas: </div>
                <div class="rate col-md-5" data-score="<?php echo $this->company['workoverload']; ?>"> </div>
            </div>
            <div class="row">
                <div class="col-sm-7" style="font-size: 13px;"> Colegas e equipe: </div>
                <div class="rate col-md-5" data-score="<?php echo $this->company['coworkers']; ?>"> </div>
            </div>
            <div class="row">
                <div class="col-sm-7" style="font-size: 13px;"> Salário e Benefícios: </div>
                <div class="rate col-md-5" data-score="<?php echo $this->company['salary']; ?>"> </div>
            </div>
            <div class="row" style="margin: 5px;"></div>
            <!-- fim estrelas -->
        </div>
        <div class="col-md-8" style="background-color: #FFF; height: 380px;">
            <div class="row">
                <div class="col-md-6" style="margin-left: 2px;">
                    <span class="fa fa-inbox"></span><span style="font-weight: bolder; margin-left: 5px; margin-right: 5px;">Categoria: </span> <?php echo $this->company['category']; ?>
                </div>
                <div class="col-md-4" style="margin-left: 2px;">
                    <span class="fa fa-users"></span><span style="font-weight: bolder; margin-left: 5px; margin-right: 5px;">Tamanho: </span> <?php echo $this->company['size']; ?>
                </div>
            </div>
            <div class="row" style="margin: 5px; padding-top: 25px; width: 100%; text-align: justify;">
                <span style="font-weight: bolder; margin-right: 10px;">Descrição: </span>
                <?php echo $this->company['description']; ?>
            </div>
            <!-- 
            <div class="row" style="margin: 5px; padding-top: 30px; width: 100%;">
                <div class="row" style="font-weight: bolder; margin-right: 10px;">Fotos: </div>
                <div class="row">
                    <div class="col-md-2"><img src="<?php echo $this->baseUrl() . '/images/tmp/faccat1.jpg' ?>"></div>
                    <div class="col-md-2"><img src="<?php echo $this->baseUrl() . '/images/tmp/faccat2.jpg' ?>"></div>
                    <div class="col-md-2"><img src="<?php echo $this->baseUrl() . '/images/tmp/faccat3.jpg' ?>"></div>
                </div>
            </div>
            -->
        </div>
        <!-- //// -->
        
    </div>
    
    <!-- evaluations -->
    <?php foreach ($this->company['evaluations'] AS $key => $evaluation) { 
        if (($evaluation['actual'] == 1) && ($evaluation['gender'] == 'm')) {
            $atual = "funcionário";
            $gender = 'male';
        } elseif (($evaluation['actual'] == 1) && ($evaluation['gender'] == 'f')) {
            $atual = "funcionária";
            $gender = 'female';
        } elseif (($evaluation['actual'] == 0) && ($evaluation['gender'] == 'f')) {
            $atual = "ex-funcionária";
            $gender = 'female';
        } elseif (($evaluation['actual'] == 0) && ($evaluation['gender'] == 'm')) {
            $atual = "ex-funcionário";
            $gender = 'male';
        }
        ?>
        <div class="row" style="padding-top: 40px">
            <div class="col-md-3" style="width: 325px"></div>
            <div class="col-md-8" style="border: #e5e5e5; border-style: dashed; border-width: 3px; background-color: #FFF">
                <div class="row" style="margin-top: 5px;">
                    <div class="col-md-1 center">
                        <div class="row"><img style="margin-top: 8px;" src="<?php echo $this->baseUrl() . '/img/'.$gender.'.png' ?>"></div>
                    </div>
                    <div class="col-md-8">
                        <div class="row"> <span style="font-size: 20px;"><?php echo $evaluation['function']; ?>(<?php echo $atual; ?>) em <?php echo $evaluation['location']; ?></span> </div>
                        <div class="row"> 
                            <div class="col-md-3"><span style="font-size: 14px; color: #CCC"> <span style="font-weight: bold">Ano:</span> <?php echo $evaluation['year']; ?> </span> </div>
                            <div class="col-md-5"><span style="font-size: 14px; color: #CCC"> <span style="font-weight: bold">Faixa etária:</span> <?php echo $evaluation['age']; ?> anos </span> </div>
                        </div>
                    </div>
                    <div class="col-sm-3" style="width: 25%; text-align: center; margin-left: -10px">
                        
                        <div class="row"><div class="rate-eval" data-score="<?php echo $evaluation['star_rate']; ?>"></div></div>
                        <div class="row"><a style="margin-left: 125px; font-size: 10px; margin-top: -50px" data-toggle="modal" data-target="#rate-datails-<?php echo $key; ?>" href="javascript://" ><span class="fa fa-search"></span>Detalhes</a></div>
                    </div>
                </div>
                <div class="row" style="margin-top: 5px;">
                    <span class="fa fa-quote-left" style="margin-right: 10px; margin-left: 10px;"></span>
                    <?php echo $evaluation['opinion']; ?>
                </div>
                <div class="row" style="margin-top: 5px;">
                    <div class="col-md-12" style="width: 100%; text-align: right;">
                        <div class="row" style="margin-right: 5px; font-weight: bold; color: #5b5b5b">Recomenda esta empresa?</div>
                        <?php if ($evaluation['recomend'] == 1) { ?>
                            <div class="row" style="color: #47a447; margin-right: 75px; font-size: 16px;">
                                <span class="fa fa-thumbs-o-up" style="margin-right: 5px;"></span>
                                <span style="font-weight: bold"> SIM </span>
                            </div>
                        <?php } else { ?>
                            <div class="row" style="color: #d2322d; margin-right: 75px; font-size: 16px;">
                                <span class="fa fa-thumbs-o-down" style="margin-right: 5px;"></span>
                                <span style="font-weight: bold"> NÃO </span>
                            </div>
                        <?php } ?>
                    </div>
                </div>
            </div>
        </div>
        <!-- Popover -->
        <div id="rate-datails-<?php echo $key; ?>" class="modal fade bs-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
          <div class="modal-dialog modal-sm" style="width: 340px;">
            <div class="modal-content">
                <div class="modal-header" style="height: 50px;">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <div class="row" style="width: 100%; text-align: center;"> <h2> Detalhes </h2> </div>
                </div>
                <div class="col-md-2" style="margin-right: 10px; width: 315px; height: 380px;">
                    <!--   Inicio Estrelas -->
                    <div class="row">
                        <div class="col-sm-7" style="font-size: 13px;"> Visão & Estratégia: </div>
                        <div class="rate col-md-5" data-score="<?php echo $evaluation['strategy']; ?>"> </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-7" style="font-size: 13px;"> Chefia: </div>
                        <div class="rate col-md-5" data-score="<?php echo $evaluation['leadership']; ?>"> </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-7" style="font-size: 13px;"> Cultura & Valores: </div>
                        <div class="rate col-md-5" data-score="<?php echo $evaluation['culture']; ?>"> </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-7" style="font-size: 13px;"> Oportunidade/Carreira: </div>
                        <div class="rate col-md-5" data-score="<?php echo $evaluation['opportunity']; ?>"> </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-7" style="font-size: 13px;">  Reconhecimento/Promoção: </div>
                        <div class="rate col-md-5" data-score="<?php echo $evaluation['recognition']; ?>"> </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-7" style="font-size: 13px;"> Ambiente de Trabalho: </div>
                        <div class="rate col-md-5" data-score="<?php echo $evaluation['workspace']; ?>"> </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-7" style="font-size: 13px;"> Pagamento em dia: </div>
                        <div class="rate col-md-5" data-score="<?php echo $evaluation['payment']; ?>"> </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-7" style="font-size: 13px;"> Flexibilidade Horário: </div>
                        <div class="rate col-md-5" data-score="<?php echo $evaluation['flexibility']; ?>"> </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-7" style="font-size: 13px;"> Sobrecarga de tarefas: </div>
                        <div class="rate col-md-5" data-score="<?php echo $evaluation['workoverload']; ?>"> </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-7" style="font-size: 13px;"> Colegas e equipe: </div>
                        <div class="rate col-md-5" data-score="<?php echo $evaluation['coworkers']; ?>"> </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-7" style="font-size: 13px;"> Salário e Benefícios: </div>
                        <div class="rate col-md-5" data-score="<?php echo $evaluation['salary']; ?>"> </div>
                    </div>
                    <div class="row" style="margin: 5px;"></div>
                    <!-- fim estrelas -->
                </div>    
                <div class="row" style="margin: 5px;"></div> 
            </div>
          </div>
        </div>

        
        
        
            
        <script type="text/javascript">
            
              $("#ratepopover-<?php echo $key; ?>").raty({ path: '<?php echo $this->baseUrl() . "/img/stars/" ?>', size: 22, readOnly: true, halfShow : true, score: function() {return $(this).attr('data-score');}});
              $("#rate-<?php echo $key; ?>").popover({
                      placement : 'left', //placement of the popover. also can use top, bottom, left or right
                          title : '<div style="text-align:center; font-size:14px;"> Detalhes </div>', //this is the top title bar of the popover. add some basic css
                            html: 'true', //needed to show html of course
                        content : $('#details-<?php echo $key; ?>').text() //this is the content of the html box. add the image here or anything you want really.
                });
            
        </script>
    <?php } ?>
    
    
    
    <div class="row">
        <div class="col-md-12" style="width: 100%; text-align: center;">
            <a href="<?php echo $this->url(array('controller' => 'evaluation', 'action' => 'avaliar', 'company' => $this->company['friendly_name'])); ?>" class="btn btn-large btn-success" style="width: 55%; text-align: center; text-transform: uppercase; font-weight: bold; margin-top: 4em;">Já trabalhou nesta empresa? Avalie agora.</a>
        </div>
    </div>
</div><!-- end section -->
<br />

<script type="text/javascript">
$(document).ready(function() {
  $("#general-rate").raty({ path: '<?php echo $this->baseUrl() . "/img/stars-big/" ?>', size: 44, readOnly: true, halfShow : true, score: function() {return $(this).attr('data-score');}});
  $(".rate").raty({ path: '<?php echo $this->baseUrl() . "/img/stars/" ?>', size: 22, readOnly: true, halfShow : true, score: function() {return $(this).attr('data-score');}});
  $(".rate-eval").raty({ path: '<?php echo $this->baseUrl() . "/img/stars-medium/" ?>', size: 44, readOnly: true, halfShow : true, score: function() {return $(this).attr('data-score');}});
});
  
  
</script>